#!/usr/bin/env node

const cp=require('child_process'),
      cmd=process.argv[2],
      args=process.argv.slice(3,process.argv.length);
console.log(cmd);
console.log(args);
//process.exit();  ./01-exec-file.js cat a.js b.js c.js   查看cmd和args变量是否正确

cp.execFile(cmd,args,(err,stdout)=>{
  console.log(stdout.toString('utf8'));
});
//查看自己的文件内容
//./01-exec-file.js cat 02-spawn-vl.js 03-child.js
